// FoodsRecipeServiceImpl.java
package com.example.service.impl;

import com.example.dao.FoodsRecipeDao;
import com.example.entity.FoodsRecipe;
import com.example.service.FoodsRecipeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

@Service
public class FoodsRecipeServiceImpl implements FoodsRecipeService {

    @Autowired
    private FoodsRecipeDao foodsRecipeDao;

    @Override
    public List<FoodsRecipe> getAllFoodsRecipe() {
        return foodsRecipeDao.findAll();
    }

    @Override
    public FoodsRecipe getFoodsRecipeById(Integer foodsrecipeId) {
        return foodsRecipeDao.findById(foodsrecipeId);
    }

    @Override
    public List<FoodsRecipe> getRecommendedRecipes() {
        // 调用DAO层新增的方法
        return foodsRecipeDao.findRecommended();
    }

    @Override
    public List<FoodsRecipe> getAllRecipes() {
        return Collections.emptyList();
    }
}